package com.personal.system.mapper.seckill;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.personal.system.entity.seckill.Goods;
import com.personal.system.entity.seckill.SeckillGoods;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;
import java.util.List;

public interface SeckillGoodsMapper extends BaseMapper<SeckillGoods> {

    List<Goods> selectAllGoods();

    IPage<Goods> selectAllGoods(@Param("page") Page<Goods> page);

    IPage<SeckillGoods> selectSecGoods(@Param("page")Page<SeckillGoods> page, SeckillGoods goods);

    SeckillGoods getById(Long id);

    @Update("update goods set goods_name = #{goodsName},goods_title = #{goodsTitle}," +
            "goods_price = #{goodsPrice} where id = #{goodsId}")
    int updateGoods(SeckillGoods goods);
}
